package com.scuec.groupfive.Controller;

import com.scuec.groupfive.service.UserPostFavoriteService;
import com.scuec.groupfive.vo.UserPostFavoriteVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/user/post/favorite")
public class UserPostFavoriteController {

    @Autowired
    private UserPostFavoriteService userPostFavoriteService;

    @PostMapping("/add")
    public String addFavorite(@RequestBody UserPostFavoriteVO postFavoriteVO) {
        return userPostFavoriteService.favoritePost(postFavoriteVO);
    }

    @PostMapping("/remove")
    public String removeFavorite(@RequestBody UserPostFavoriteVO postFavoriteVO) {
        return userPostFavoriteService.unfavoritePost(postFavoriteVO);
    }
}